﻿#include <iostream>
using namespace std;

int seq_search(int* a, int n, int key) {
	for (int i = 0; i < n; i++) {
		if (*a++ == key) {
			return i;
		}
	}
	return -1;
}

int main() {
	int a[] = { 1,2,3,4,5 };

	cout << seq_search(a, 5, 3);

	cin.get();
}